package com.geekaca.d09;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class FileOutputStream6 {
    public static void main(String[] args) {
        OutputStream ops = null;
        try {
            ops = new FileOutputStream("myOut.txt");
            ops.write('A');
            ops.write("张".getBytes(StandardCharsets.UTF_8));
            ops.write(98);
            ops.flush();// 写出 把内容写出到文件;
            ops.close();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if(ops!=null){
                try {
                    ops.close();
                } catch (IOException e) {}
            }
        }
    }
}
